package org.dtrd.modules.shop.entity.bean;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.dtrd.modules.shop.entity.po.DtrdEntShcRdOrder;
import org.dtrd.modules.shop.entity.po.DtrdEntShcRdOrderJoinProduct;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 订单记录表
 * </p>
 *
 * @author sun
 * @since 2022-07-28
 */
@Data
@ApiModel(value = "订单记录表列表信息", description = "订单记录表")
public class OrderListInfo {

    @ApiModelProperty("订单ID")
    private String dataId;

    @ApiModelProperty("用户ID")
    private Integer orderInfoUserid;

    @ApiModelProperty("用户名称")
    private String patientName;

    @ApiModelProperty("用户头像")
    private String patientAvatar;
    @ApiModelProperty("用户手机号")
    private String patientMobile;

    @ApiModelProperty("订单标题")
    private String orderInfoTitle;

    @ApiModelProperty("订单编号，供前端展示")
    private String orderInfoNo;

    @ApiModelProperty("订单总金额，单位分")
    private Long orderInfoSum;

    @ApiModelProperty("订单实际支付金额，单位分")
    private Integer orderInfoPayment;

    @ApiModelProperty("支付状态 0 未支付，1已支付")
    private Integer orderInfoPaystatus;
    private String orderInfoPaystatusText;

    @ApiModelProperty("订单状态，1 待支付 2 已取消 3 已支付 4 已完成 ")
    private Integer orderInfoOrderstatus;
    private String orderInfoOrderstatusText;

    @ApiModelProperty("支付时间")
    private Date payTime;

    @ApiModelProperty("完成时间")
    private Date completeTime;

    @ApiModelProperty("订单类型，0-商城订单,1-医生服务-图文咨询,2-医生服务-电话咨询,3-医生服务-预约服务,4-医生服务-控糖服务")
    private Integer orderInfoType;

    @ApiModelProperty("关联服务包ID")
    private Integer orderInfoServiceId;

    @ApiModelProperty("订单微信公众号二维码")
    private String orderInfoQrcode;

    @ApiModelProperty("订单微信公众号二维码result")
    private String orderInfoQrcodeResult;

    @ApiModelProperty("支付方式 1支付宝 2 微信支付 3 现金支付")
    private Integer orderInfoPayType;

    @ApiModelProperty("第三方支付订单号")
    private String transactionId;

    @ApiModelProperty("订单备注")
    private String remark;

    @ApiModelProperty("配送方式：1-线下领取，2-配送到家")
    private Integer orderInfoDeliveryType;

    @ApiModelProperty("购买方式：1-购买新机、2-以旧换新")
    private Integer orderInfoBuyType;

    @ApiModelProperty("机构")
    private String orgCode;

    @ApiModelProperty("商品分类")
    private Integer orderInfoProductCategory;

    @ApiModelProperty("商品明细")
    private List<DtrdEntShcRdOrderJoinProduct> orderInfoProducts;

    public OrderListInfo(DtrdEntShcRdOrder po) {
        dataId = po.getDataId();
        orderInfoUserid = po.getOrderInfoUserid();
        orderInfoTitle = po.getOrderInfoTitle();
        orderInfoNo = po.getOrderInfoNo();
        orderInfoSum = po.getOrderInfoSum();
        orderInfoPayment = po.getOrderInfoPayment();
        orderInfoPaystatus = po.getOrderInfoPaystatus();
        orderInfoOrderstatus = po.getOrderInfoOrderstatus();
        payTime = po.getPayTime();
        completeTime = po.getCompleteTime();
        orderInfoType = po.getOrderInfoType();
        orderInfoServiceId = po.getOrderInfoServiceId();
        orderInfoQrcode = po.getOrderInfoQrcode();
        orderInfoQrcodeResult = po.getOrderInfoQrcodeResult();
        orderInfoPayType = po.getOrderInfoPayType();
        transactionId = po.getTransactionId();
        remark = po.getRemark();
        orderInfoDeliveryType = po.getOrderInfoDeliveryType();
        orderInfoBuyType = po.getOrderInfoBuyType();
        orgCode = po.getOrgCode();
        orderInfoProductCategory = po.getOrderInfoProductCategory();
    }
}
